package seismosurfer.data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import seismosurfer.data.constants.QuakeConstants;

/**
 * Contains minimum and maximum values for some of the database fields that are
 * needed from the client.
 */
public class QuakeMaxMinData implements QuakeConstants, Serializable {
    
    private static final long serialVersionUID = -5677460835786740774L;

    protected static Map minMaxValues = new HashMap();

    public QuakeMaxMinData() {

    }

    public static double getDBMinMagnitude() {
        return ((Double) minMaxValues.get(MIN_MAGNITUDE)).doubleValue();
    }

    public static double getDBMaxMagnitude() {
        return ((Double) minMaxValues.get(MAX_MAGNITUDE)).doubleValue();
    }

    public static double getDBMinDepth() {
        return ((Double) minMaxValues.get(MIN_DEPTH)).doubleValue();
    }

    public static double getDBMaxDepth() {
        return ((Double) minMaxValues.get(MAX_DEPTH)).doubleValue();
    }

    public static double getDBMinLatitude() {
        return ((Double) minMaxValues.get(MIN_LATITUDE)).doubleValue();
    }

    public static double getDBMaxLatitude() {
        return ((Double) minMaxValues.get(MAX_LATITUDE)).doubleValue();
    }

    public static double getDBMinLongitude() {
        return ((Double) minMaxValues.get(MIN_LONGITUDE)).doubleValue();
    }

    public static double getDBMaxLongitude() {
        return ((Double) minMaxValues.get(MAX_LONGITUDE)).doubleValue();
    }

    public static long getDBMinTime() {
        return ((Long) minMaxValues.get(MIN_TIME)).longValue();
    }

    public static long getDBMaxTime() {
        return ((Long) minMaxValues.get(MAX_TIME)).longValue();
    }

    public static void setMinMaxValues(Map values) {
        minMaxValues = values;
    }

}
